<template>
  <i class="svg-icon ti" :class="svgClass" />
</template>

<script>
import { computed } from 'vue'
export default {
  name: 'SvgIcon',
  props: {
    iconClass: {
      type: String,
      required: true
    }
  },
  setup(props) {
    const iconName = computed(() => props.iconClass)
    const svgClass = computed(() => {
      return `ti-${props.iconClass}`
    })
    return {
      svgClass,
      iconName
    }
  }
}
</script>

<style scoped>
  .svg-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
    display: inline-block;
  }
</style>
